<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>XMS AE-API</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/global.css">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/jquery-confirm.min.css" rel='stylesheet' type='text/css' />
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/jquery-confirm.min.js"></script>
<script src="/js/common.js"></script>
</head>
<body>
	<%@include file="inc/menu-nav.jsp" %>
	<div class="container create-order">
		<h3 class="head-title">创建订单B段</h3>
		<form class="xml-form">
			<div class="form-group">
				<label for="xml">请求报文：</label>
				<textarea class="form-control area-xml" required="required" placeholder="必须是标准的xml格式" name="xml" id="xml">${xml }</textarea> 
			</div>
			<div class="form-group text-right">
				<button type="submit" class="btn btn-danger"> 提交 </button>
			</div>
		</form>
	</div>
</body>
<script type="text/javascript">
	$(function(){
		$('.xml-form').submit(function(){
			var param = {
				xml: $('#xml').val(),
				msg_type: 'LOGISTICS_BATCH_SEND'
			};
			var progress = Tips.tips('<i class="icon-spinner icon-spin ext-spinner"></i> 正在推送订单，请稍候...');
	        $.post('/order/save', param, function(result){
	        	progress.close();
	        	var content = '';
	        	if(result.status == 0){
	        		content = '<i class="icon-error icon-remove-sign"></i> ' + result.msg;
	        	}else{
	        		content = '<i class="icon-success icon-ok-sign"></i> ' + result.msg;
	        	}
	        	Tips.tips(content);
	        });
			return false;
		});
	});
</script>
</html>